Skip to content

Add explanatory comment for ImportError handling in plugin discovery#56

Merged
k-yoshimi merged 4 commits intofeature/solver-plugin-architecturefrom
copilot/sub-pr-53-another-one
Jan 29, 2026
Merged

Add explanatory comment for ImportError handling in plugin discovery#56
k-yoshimi merged 4 commits intofeature/solver-plugin-architecturefrom
copilot/sub-pr-53-another-one

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 29, 2026

Addresses feedback on PR #53 regarding an empty except ImportError: pass clause with no explanation in _discover_plugins().

Changes

  • Added comment explaining why ImportError is caught and ignored: handles cases where solvers package is unavailable (minimal install, missing dependencies, corrupted package)
  • Plugin lookup subsequently fails with helpful KeyError listing available plugins
  • Updated .gitignore to exclude Python build artifacts (*.egg-info/, dist/)
def _discover_plugins() -> None:
    """Load built-in plugins by importing the solvers package."""
    try:
        import stdface.solvers  # triggers auto-registration
    except ImportError:
        # Solvers package not available (e.g., minimal install, missing
        # dependencies, or corrupted package). Plugin lookup will fail
        # with a helpful KeyError listing available plugins.
        pass

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 29, 2026 12:12
Co-authored-by: k-yoshimi <4516893+k-yoshimi@users.noreply.github.com>
Co-authored-by: k-yoshimi <4516893+k-yoshimi@users.noreply.github.com>
Copilot AI changed the title [WIP] Update lattice plugin architecture based on feedback Add explanatory comment for ImportError handling in plugin discovery Jan 29, 2026
Copilot AI requested a review from k-yoshimi January 29, 2026 12:14
@k-yoshimi k-yoshimi marked this pull request as ready for review January 29, 2026 12:15
@k-yoshimi k-yoshimi merged commit 6b1f6ba into feature/solver-plugin-architecture Jan 29, 2026
12 checks passed
@k-yoshimi k-yoshimi deleted the copilot/sub-pr-53-another-one branch January 29, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants